package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YongyouXsckMapper;
import com.ruoyi.quartz.domain.YongyouXsck;
import com.ruoyi.quartz.service.IYongyouXsckService;

/**
 * 销售出库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-17
 */
@Service
public class YongyouXsckServiceImpl implements IYongyouXsckService 
{
    @Autowired
    private YongyouXsckMapper yongyouXsckMapper;

    /**
     * 查询销售出库
     * 
     * @param vouchdate 销售出库主键
     * @return 销售出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public YongyouXsck selectYongyouXsckByVouchdate(String vouchdate)
    {
        return yongyouXsckMapper.selectYongyouXsckByVouchdate(vouchdate);
    }

    /**
     * 查询销售出库列表
     * 
     * @param yongyouXsck 销售出库
     * @return 销售出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<YongyouXsck> selectYongyouXsckList(YongyouXsck yongyouXsck)
    {
        return yongyouXsckMapper.selectYongyouXsckList(yongyouXsck);
    }

    /**
     * 新增销售出库
     * 
     * @param yongyouXsck 销售出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertYongyouXsck(YongyouXsck yongyouXsck)
    {
        return yongyouXsckMapper.insertYongyouXsck(yongyouXsck);
    }

    /**
     * 修改销售出库
     * 
     * @param yongyouXsck 销售出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateYongyouXsck(YongyouXsck yongyouXsck)
    {
        return yongyouXsckMapper.updateYongyouXsck(yongyouXsck);
    }

    /**
     * 批量删除销售出库
     * 
     * @param vouchdates 需要删除的销售出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouXsckByVouchdates(String[] vouchdates)
    {
        return yongyouXsckMapper.deleteYongyouXsckByVouchdates(vouchdates);
    }

    /**
     * 删除销售出库信息
     * 
     * @param vouchdate 销售出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouXsckByVouchdate(String vouchdate) {
        return yongyouXsckMapper.deleteYongyouXsckByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouXsckByDate(String vouchdate) {
        return yongyouXsckMapper.deleteYongyouXsckByDate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearXsck() {
        return yongyouXsckMapper.clearXsck();
    }
}
